{% extends "base.html" %}		
{% block active2 %}active{% endblock %}
{% block BODY %}

<section id="article" class="main">
	<br/>
	<br/>
	<div class="container">
		<div class="row">
			<div class="span8">
				<ul class="nav-articles">
        		<nav>
            		<ul class="nav nav-tabs">
                		<li class="active">
                    		<a href="/">评论</a>
                		</li>
                		<li class="">
                    		<a href="tags/">标签</a>
                		</li>
            		</ul>
        		</nav>
				<table class="table table-hover">
				{% if reviewsInfo %}
				共：{{total}} 正确：{{right}} 错误：{{wrong}} 未知：{{unknown}}
              	<thead>
                <tr>
                  <th >#</th>
                  <th width=50>标签</th>
                  <th >评论</th>
                  <th >正确</th>
                  <th >错误</th>
                  <th >结果</th>
                </tr>
              	</thead>
				{% endif %}
              	<tbody>
				{% for view in reviewsInfo %}
                <tr>
                  <td class='coms'>{{view.id}}</td>
                  <td> <span style="background-color:#FF9900;color:#FFFFFF;">{{view.tag}}</span> </td>
                  <td>{{view.review|safe}}</td>
                  <td><input type="radio" onclick="test('check=1&id={{view.id}}')" ></td>
                  <td><input type="radio" onclick="test('check=2&id={{view.id}}')" ></td>
				  {% ifequal view.flag '1' %}
				  	<td><i class="icon-ok"></i></td>
				  {% endifequal %}
				  {% ifequal view.flag '2' %}
					<td><i class="icon-remove"></i></td>
				  {% endifequal %}
                </tr>
				{% endfor %}
              	</tbody>
            	</table>
				</ul>
			</div>
    <script type="text/javascript">
        function test(n){ 
            $.ajax({
            type: "get",
            url: "/",
            data: n,
            success: function(){
				alert('修改成功');
				window.location.href="/";
            },       
       
        error: function(){
        alert('修改失败');
        }
        });
        }
    </script>


			<aside class="span3 offset1">
				<a class="brand" href="/"><img src="/static/Images/phone.jpg"></a>
				<h3><i class="icon-book"></i> 在这里输入评论</h3>
				<form action="/" method="post">
        		{% csrf_token %}
        			<p><textarea style="margin: 0px 0px 10px; width: 205px; height: 200px;" name="review" rows="10" cols="3"></textarea> </p>
           			<input class="btn btn-mini btn-primary" type="submit" value="提交评论" style="width:220px;height:30px">
        			</p>
        		</form>

			</aside>
		</div>
	</div>
	<br>
	<br>
</section>
{% endblock %}

